﻿Imports Ultimus.WFServer
'Imports beCapitalAdicional
Partial Public Class frmConfirmacionFlujoDatosPrc
    Inherits System.Web.UI.Page
    Private nombrePaso As String
    Private ruta As String
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Try
            If Not Page.IsPostBack Then
                ' Cargar Variables Ultimus 
                Dim staskid As String = Request.Cookies("TaskId").Value
                Session("TaskId") = staskid
                Dim oTask As New Task
                oTask.InitializeFromTaskId(staskid)
                nombrePaso = oTask.strStepName

                ' Cargar fomrmulario
                Title = nombrePaso
                lblTitulo.Text = nombrePaso

                ConfigurarScripts()
            End If
        Catch ex As Exception

        End Try
    End Sub
    Private Sub ConfigurarScripts()
        ruta = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + HttpContext.Current.Request.ApplicationPath
        btnComentario.Attributes.Add("onclick", "VerComentario('" + ruta + "');")
        btnTrazabilidad.Attributes.Add("onclick", "VerTrazabilidad('" + ruta + "');")
        imbRetornar.Attributes.Add("onclick", "VerPasoRetroceso('" + ruta + "','" + nombrePaso + "');")

    End Sub

    Protected Sub imbEnviar_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imbEnviar.Click
        Dim sUser As String = Request.Cookies("UserId").Value
        Dim staskid As String = Request.Cookies("TaskId").Value

        Dim oTask As New Task
        oTask.InitializeFromTaskId(staskid)
        Dim nIncident As Integer = 0
        Dim sError As String = ""
        oTask.Send(Nothing, Nothing, Nothing, nIncident, sError)

        ScriptManager.RegisterStartupScript(Me, Page.GetType, "Aviso", "window.close();", True)
    End Sub

End Class